import QtQuick 2.0

Item{
    id: _root
    anchors.fill: parent

    property real pos_x: 0
    property real pos_y: 0
    property real pos_z: 0
    property real pos_ry: 0

    signal clicked(variant mouse, int id)

    Column{
        anchors.right: parent.right
        anchors.bottom: parent.bottom

        Column{
            Text{
                color: "#dddddd"
                text: "x:" + pos_x
            }
            Text{
                color: "#dddddd"
                text: "y:" + pos_y
            }
            Text{
                color: "#dddddd"
                text: "z:" + pos_z
            }
            Text{
                color: "#dddddd"
                text: "r:" + pos_ry
            }
        }

        Grid{
            id: _btn
            columns: 3
            rows: 3
            spacing: 1
            property real btnWidth: 40
            property real btnHeight: 20
            //左ターン
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "T"
                onClicked: {
                    _root.clicked(mouse, 20);
                }
            }
            //上
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "N"
                onClicked: {
                    _root.clicked(mouse, 10);
                }
            }
            //右ターン
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "B"
                onClicked: {
                    _root.clicked(mouse, 21);
                }
            }
            //左
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "W"
                onClicked: {
                    _root.clicked(mouse, 11);
                }
            }
            //後ろ
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "S"
                onClicked: {
                    _root.clicked(mouse, 12);
                }
            }
            //右
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "E"
                onClicked: {
                    _root.clicked(mouse, 13);
                }
            }
            //追加
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "L"
                onClicked: {
                    _root.clicked(mouse, 30);
                }
            }
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "G"
                onClicked: {
                    _root.clicked(mouse, 31);
                }
            }
            Button{
                width: parent.btnWidth
                height: parent.btnHeight
                color: "#55ff55"
                text: "CHK"
                onClicked: {
                    _root.clicked(mouse, 32);
                }
            }
        }
    }
}
